package com.tao.service.rabbitMQ;

import com.tao.pojo.Coding;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


@RabbitListener(queues = "coding.topic.queue")
@Component
public class CodingRabbitMqService {

// @RabbitHandler 代表此方法是一个消息接收的方法。该不要有返回值
    @RabbitHandler
    public void CodingSerevice(Coding message) {
        // 此处省略发邮件的逻辑
        System.out.println("msg Coding-------------->" +message.toString() );
    }

}